/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ideastec.mipyme.model.email;

import com.ideastec.mipyme.model.EntidadPersistible;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 *
 * @author Diego Rafael Graf
 */

public class Email extends EntidadPersistible{
    
    private String email;
    
    public Email(){
        
    }
    
    public Email(String email){
        this.email = email;
    }
    
    @Override
    public String toString(){
        return this.email;
    }
    
    public String getEmail(){
        return this.email;        
    }
    
    public void setEmail(String email){
        this.email = email;
    }

    
    @Override
    public boolean equals(Object objeto){
        if(objeto == null || !objeto.getClass().isAssignableFrom(Email.class)){
            return false;
        }else{
            Email email2 = (Email) objeto;
            return new EqualsBuilder().append(email2.toString(), this.toString()).isEquals();
        }
    }
    
    @Override
    public int hashCode(){
        return new HashCodeBuilder().append(this.toString()).append(this.toString()).toHashCode();
    }
    
}